<html>
<head><meta charset="utf-8"><title>playground-mir-output · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/playground-mir-output.html">playground-mir-output</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="135255704"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/playground-mir-output/near/135255704" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/playground-mir-output.html#135255704">(Oct 05 2018 at 13:46)</a>:</h4>
<p>Does anyone know why I always see:</p>
<div class="codehilite"><pre><span></span>warning: due to multiple output types requested, the explicitly specified output file name will be adapted for each output type

warning: ignoring --out-dir flag due to -o flag

warning: ignoring -C extra-filename flag due to -o flag
</pre></div>


<p>and no MIR output when trying to output MIR  from the playground?</p>



<a name="135255727"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/playground-mir-output/near/135255727" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/playground-mir-output.html#135255727">(Oct 05 2018 at 13:47)</a>:</h4>
<p>Only happens when there's a compilation failure.</p>



<a name="135256147"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/playground-mir-output/near/135256147" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/playground-mir-output.html#135256147">(Oct 05 2018 at 13:55)</a>:</h4>
<p>It shouldn't be only when there's a failure...</p>
<p>It's because of the way that the command line is constructed. Lemme see if I can rustle it up.</p>



<a name="135256217"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/playground-mir-output/near/135256217" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/playground-mir-output.html#135256217">(Oct 05 2018 at 13:56)</a>:</h4>
<p>Well, the only time I run into it is when there's a failure.</p>



<a name="135256231"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/playground-mir-output/near/135256231" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/playground-mir-output.html#135256231">(Oct 05 2018 at 13:57)</a>:</h4>
<p>I often try get the MIR output for a failing test case on the playground so I can understand what's happening better - it's quicker than writing it to a file and dumping it locally.</p>



<a name="135256458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/playground-mir-output/near/135256458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/playground-mir-output.html#135256458">(Oct 05 2018 at 14:00)</a>:</h4>
<div class="codehilite"><pre><span></span>Compilation command is &quot;docker&quot; &quot;run&quot; &quot;--rm&quot; &quot;--cap-drop=ALL&quot; &quot;--cap-add=DAC_OVERRIDE&quot; &quot;--security-opt=no-new-privileges&quot; &quot;--workdir&quot; &quot;/playground&quot; &quot;--net&quot; &quot;none&quot; &quot;--memory&quot; &quot;256m&quot; &quot;--memory-swap&quot; &quot;320m&quot; &quot;--env&quot; &quot;PLAYGROUND_TIMEOUT=10&quot; &quot;--pids-limit&quot; &quot;512&quot; &quot;--volume&quot; &quot;/var/folders/_b/d4_bd15x7s5g99cjvyhpw26w0000gp/T/33433498d126482c8c126597d9eb9c98:/playground/src/main.rs&quot; &quot;--volume&quot; &quot;/var/folders/_b/d4_bd15x7s5g99cjvyhpw26w0000gp/T/9d2b307dc4d9471f890629a2bca5f037:/playground-result&quot; &quot;rust-stable&quot; &quot;cargo&quot; &quot;rustc&quot; &quot;--&quot; &quot;-o&quot; &quot;/playground-result/compilation&quot; &quot;--emit=mir&quot;
</pre></div>



<a name="135256484"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/playground-mir-output/near/135256484" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/playground-mir-output.html#135256484">(Oct 05 2018 at 14:01)</a>:</h4>
<p>So <code>cargo rustc -- -o /playground-result/compilation --emit=mir</code></p>



<a name="135256601"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/playground-mir-output/near/135256601" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/playground-mir-output.html#135256601">(Oct 05 2018 at 14:03)</a>:</h4>
<p>But I see it in success cases, like <code>fn example() {}</code>:</p>
<div class="codehilite"><pre><span></span>Standard Error
   Compiling playground v0.0.1 (file:///playground)
warning: due to multiple output types requested, the explicitly specified output file name will be adapted for each output type

warning: ignoring --out-dir flag due to -o flag

warning: ignoring -C extra-filename flag due to -o flag

warning: function is never used: `example`
 --&gt; src/lib.rs:1:1
  |
1 | fn example() {}
  | ^^^^^^^^^^^^
  |
  = note: #[warn(dead_code)] on by default

    Finished dev [unoptimized + debuginfo] target(s) in 0.51s
Result
// WARNING: This output format is intended for human consumers only
// and is subject to change without notice. Knock yourself out.
fn example() -&gt; (){
    let mut _0: ();                      // return place

    bb0: {
        return;                          // bb0[0]: scope 0 at src/lib.rs:1:16: 1:16
    }
}
</pre></div>



<a name="135256622"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/playground-mir-output/near/135256622" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/playground-mir-output.html#135256622">(Oct 05 2018 at 14:03)</a>:</h4>
<p>IIRC, it's because Cargo also specifies an output directory, and then we override it.</p>



<a name="135256689"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/playground-mir-output/near/135256689" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/playground-mir-output.html#135256689">(Oct 05 2018 at 14:04)</a>:</h4>
<p>Yeah, it works in success cases. When I'm working on diagnostics, it is never success cases, so every so often I forget that and try it on playground and end up needing to do it locally which is more annoying.</p>



<a name="135256725"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/playground-mir-output/near/135256725" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/playground-mir-output.html#135256725">(Oct 05 2018 at 14:05)</a>:</h4>
<p>Oh! So your real question is why is there no output? I was misled by you asking about the warning messages.</p>



<a name="135256732"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/playground-mir-output/near/135256732" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/playground-mir-output.html#135256732">(Oct 05 2018 at 14:05)</a>:</h4>
<p>I guess yeah.</p>



<a name="135256782"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/playground-mir-output/near/135256782" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/playground-mir-output.html#135256782">(Oct 05 2018 at 14:06)</a>:</h4>
<p>It'd be real helpful if the MIR was output regardless of success or failure.</p>



<a name="135256786"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/playground-mir-output/near/135256786" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/playground-mir-output.html#135256786">(Oct 05 2018 at 14:06)</a>:</h4>
<p>Well, in cases where it gets to the point in the compiler where that is generated.</p>



<a name="135256828"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/playground-mir-output/near/135256828" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/playground-mir-output.html#135256828">(Oct 05 2018 at 14:07)</a>:</h4>
<p>Is MIR actually output when the compiler fails (and when using those stable arguments)?</p>



<a name="135256844"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/playground-mir-output/near/135256844" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/playground-mir-output.html#135256844">(Oct 05 2018 at 14:07)</a>:</h4>
<p>I have no idea about stable arguments, I only ever use <code>-Z dump-mir=all</code>.</p>



<a name="135256919"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/playground-mir-output/near/135256919" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/playground-mir-output.html#135256919">(Oct 05 2018 at 14:09)</a>:</h4>
<p>Having nightly-only logic is one of the more painful parts of the playground (and expressing that difference in easily-digestible terms in the UI).</p>



<a name="135256985"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/playground-mir-output/near/135256985" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/playground-mir-output.html#135256985">(Oct 05 2018 at 14:10)</a>:</h4>
<p>you got a small example of something that should generate MIR but the playground doesn't show it?</p>



<a name="135257011"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/playground-mir-output/near/135257011" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/playground-mir-output.html#135257011">(Oct 05 2018 at 14:11)</a>:</h4>
<p>I've got <a href="https://play.rust-lang.org/?gist=e882b4c581c625bb27ad9c7c1f01d658&amp;version=nightly&amp;mode=debug&amp;edition=2015" target="_blank" title="https://play.rust-lang.org/?gist=e882b4c581c625bb27ad9c7c1f01d658&amp;version=nightly&amp;mode=debug&amp;edition=2015">this example</a> - it's a slightly modified test case of an issue I'm tackling now.</p>



<a name="135257068"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/playground-mir-output/near/135257068" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/playground-mir-output.html#135257068">(Oct 05 2018 at 14:12)</a>:</h4>
<p>Running that with <code>-Z mir-dump=all</code> gives a folder with a dozen or so files in <code>mir_dump</code>.</p>



<a name="135257861"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/playground-mir-output/near/135257861" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/playground-mir-output.html#135257861">(Oct 05 2018 at 14:25)</a>:</h4>
<p>I know that <span class="user-mention" data-user-id="116009">@nikomatsakis</span> has mused that they'd like to have <em>all</em> of those shown in the playground</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>